<template>
    <div info-container>
        <!-- 浏览列表 -->
        <div class="table-container">
            <el-table :data="blogdata.bloglist" stripe style="width: 100%" border @row-click="rowClick"
            :header-cell-style="{background:'rgb(178, 147, 147)',color:'rgb(57, 50, 50)'}">
                <el-table-column type="index" label="#"></el-table-column>
                <el-table-column prop="title" label="帖子标题"></el-table-column>
                <el-table-column prop="authorName" label="作者"></el-table-column>
                <el-table-column prop="updateTime" label="浏览时间"></el-table-column>
                
            
            </el-table>
        </div>
    </div>
</template>

<script>
    import requests from '@/api/ajax'
    export default{
        data() {
            return {
                
                blogdata: {
                    bloglist:[],
                    total: 0
                },
                currentPage: '1', //当前页 刷新后默认显示第一页
                pagesize: '5',
            }
        },
        created() {
            this.search()
        },
        methods: {
            search(){ // 获取帖子历史列表
                requests.get('/back/history').then(
                    (res) => {
                        // console.log(res)
                        this.blogdata.bloglist = res.data
                    }
                )
            },
            rowClick(data){
                // console.log(data.blogId);
                this.$router.push('/blogs/?id=' + data.blogId)
            }
        },
        
    }
</script>

<style lang="less" scoped>
.info_container{
      height: 600px;
      width: 700px;
      margin-left: 150px;
      margin-top: 50px;
      font-size: larger;
}
.select-container{
    width: 1225px;
    background-color: rgb(255, 255, 255);
    padding-left: 30px;
    padding-top: 30px;
    padding-bottom: 20px;
}
</style>